package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ReceiveCompanyMapper;
import com.ruoyi.system.domain.ReceiveCompany;
import com.ruoyi.system.service.IReceiveCompanyService;

/**
 * 客户信息Service业务层处理
 * 
 * @author he
 * @date 2025-08-13
 */
@Service
public class ReceiveCompanyServiceImpl implements IReceiveCompanyService 
{
    @Autowired
    private ReceiveCompanyMapper receiveCompanyMapper;

    /**
     * 查询客户信息
     * 
     * @param id 客户信息主键
     * @return 客户信息
     */
    @Override
    public ReceiveCompany selectReceiveCompanyById(Long id)
    {
        return receiveCompanyMapper.selectReceiveCompanyById(id);
    }

    /**
     * 查询客户信息列表
     * 
     * @param receiveCompany 客户信息
     * @return 客户信息
     */
    @Override
    public List<ReceiveCompany> selectReceiveCompanyList(ReceiveCompany receiveCompany)
    {
        return receiveCompanyMapper.selectReceiveCompanyList(receiveCompany);
    }

    /**
     * 新增客户信息
     * 
     * @param receiveCompany 客户信息
     * @return 结果
     */
    @Override
    public int insertReceiveCompany(ReceiveCompany receiveCompany)
    {
    receiveCompany.setCreateUserId(SecurityUtils.getUserId());
    receiveCompany.setCreateUserName(SecurityUtils.getUsername());
        receiveCompany.setCreateTime(DateUtils.getNowDate());
        return receiveCompanyMapper.insertReceiveCompany(receiveCompany);
    }

    /**
     * 修改客户信息
     * 
     * @param receiveCompany 客户信息
     * @return 结果
     */
    @Override
    public int updateReceiveCompany(ReceiveCompany receiveCompany)
    {
        receiveCompany.setUpdateTime(DateUtils.getNowDate());
    receiveCompany.setUpdateUserId(SecurityUtils.getUserId());
    receiveCompany.setUpdateUserName(SecurityUtils.getUsername());
        return receiveCompanyMapper.updateReceiveCompany(receiveCompany);
    }

    /**
     * 批量删除客户信息
     * 
     * @param ids 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteReceiveCompanyByIds(Long[] ids)
    {
        return receiveCompanyMapper.deleteReceiveCompanyByIds(ids);
    }

    /**
     * 删除客户信息信息
     * 
     * @param id 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteReceiveCompanyById(Long id)
    {
        return receiveCompanyMapper.deleteReceiveCompanyById(id);
    }

    @Override
    public List<ReceiveCompany> getReceiveCompanyInfoList(String paramName) {

        return receiveCompanyMapper.getReceiveCompanyInfoList(paramName);
    }
}
